# Contributor: Fabricio Silva <hi@fabricio.dev>
# Maintainer: Fabricio Silva <hi@fabricio.dev>
pkgname=par2cmdline-turbo
pkgver=1.1.1
pkgrel=1
pkgdesc="par2cmdline x ParPar: speed focused par2cmdline fork"
url="https://github.com/animetosho/par2cmdline-turbo"
arch="x86 x86_64 aarch64 armv7"
license="GPL-2.0-or-later"
makedepends="automake autoconf"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/animetosho/par2cmdline-turbo/archive/v$pkgver.tar.gz"

prepare() {
	default_prepare

	update_config_sub
	update_config_guess
}

build() {
	# Build with -std=gnu99 to enable posix_memalign()
	# https://github.com/animetosho/par2cmdline-turbo/issues/34
	export CFLAGS="$CFLAGS -std=gnu99"
	./automake.sh
	./configure --prefix=/usr
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
bb919f885134a298ba14551e21cf89a91aee292e437133e6973bef09fb5dee9a9b45e76a59320bfede864438d3ac884699be7ca3f7234896a9da14cb07ffa89d  par2cmdline-turbo-1.1.1.tar.gz
"
